import { ServiceBase } from '../api/ServiceBase';
import { ApiPre } from '../config';

const urlbase = `${ApiPre}/jsdb`;
export class ServerCacheService extends ServiceBase {
  SaveModelType(modelType: string, model: any, remark: string) {
    return this.request<boolean>(`${urlbase}/SaveModelType`, {
      modelType,
      model,
      remark
    });
  }

  GetModel(modelType: string) {
    return this.request<string>(`${urlbase}/GetModel`, {
      modelType
    });
  }
}

/**
 * 服务缓存
 */
export const ServerCache = new ServerCacheService();
